<include file="Public/header" />
<title>管理员列表</title>
</head>
</head>
<body>
<div style="padding:80px 0 20px 20px;float:left;width:98%;">
		<table class="table table-border table-bordered table-bg welcometable">
			<tbody>
			  <tr class="text-c">
			 <if condition="$api_res['flag'] eq 0 or $api_res['flag'] eq 4">
				<span style="font-size:20px;color:red;"><{$api_res['tip']}></span>
			  </if>
			  <if condition="$api_res['flag'] neq 4">
				<td style="background: #3bb4f2;font-size: 16px;font-weight: bold;color:#fff!important;">
					<a href="<{:U('Download/import',array('id'=>$download_id))}>" style="color:#fff!important;">订单模板下载<i class="icon Hui-iconfont" style="font-size:18px;">&#xe640;</i></a>
				</td>
				<td>
					<form action="<{:U('Import/doimportProduct')}>" method="post" id="postForm" enctype="multipart/form-data">
						<input type="hidden" value="<{:I('warehouse_code')}>" name="warehouse_code"/>
						<input type="hidden" value="<{:I('username')}>" name="username"/>
						<notempty name="Think.get.All">
						<input type="hidden" value="<{:I('All')}>" name="All"/>
						</notempty>
						<input type="file" class="btn btn-success" name="import"/>
						<input type="button" class="btn btn-success"  id="importP" value="导入订单"/>
					</form>
				</td>
				</if>
			  </tr>
			</tbody>
		</table>
</div>
    <include file="Public/footer_js" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script>
	<if condition="$download_id eq '3-1.xls'">
		var url="<{:U('Import/doimportPushorder')}>";
	</if>
	<if condition="$download_id eq '3-normal.xls'">
		var url="<{:U('Import/doimportPushorder_normal')}>";
	</if>
	<if condition="$download_id eq '3-1-All.xls'">
		var url="<{:U('Import/doimportPushorder_All')}>";
	</if>
	<if condition="$download_id eq '3-normal-All.xls'">
		var url="<{:U('Import/doimportPushorder_normal_All')}>";
	</if>
	<if condition="$download_id eq '3-aozhou.xlsx'">
		var url="<{:U('Importaozhou/doimportPushorder')}>";
	</if>
	$("#importP").click(function() { 
        $("#postForm").ajaxSubmit({
			url:url,
            type : "post",  
            dataType : 'json',  
            success : function(data) {
				if(data.status==1){
					layer.alert(data.message,function(){
						parent.window.location.href =parent.window.location.href;
					});
				}else{
					layer.alert(data.message);
				}
            },  
            error : function(data) {  
                layer.alert('出错');
            }  
        });  
    });

</script>
</body>
</html>